home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / amiga / gui / x / twm93053.lha / twm / screen.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-29  |  11.3 KB  |  262 lines

  1. /*
  2.  * Copyright 1989 Massachusetts Institute of Technology
  3.  *
  4.  * Permission to use, copy, modify, and distribute this software and its
  5.  * documentation for any purpose and without fee is hereby granted, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of M.I.T. not be used in advertising
  9.  * or publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  M.I.T. makes no representations about the
  11.  * suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  15.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
  16.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  17.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  18.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  19.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  20.  */
  21.  
  22. /***********************************************************************
  23.  *
  24.  * $XConsortium: screen.h,v 1.62 91/05/01 17:33:09 keith Exp $
  25.  *
  26.  * twm per-screen data include file
  27.  *
  28.  * 11-3-88 Dave Payne, Apple Computer            File created
  29.  *
  30.  ***********************************************************************/
  31.  
  32. #ifndef _SCREEN_
  33. #define _SCREEN_
  34.  
  35. #include <X11/Xlib.h>
  36. #include <X11/Xutil.h>
  37. #include <X11/cursorfont.h>
  38. #include "list.h"
  39. #include "menus.h"
  40. #include "iconmgr.h"
  41.  
  42. typedef struct _StdCmap {
  43.     struct _StdCmap *next;        /* next link in chain */
  44.     Atom atom;                /* property from which this came */
  45.     int nmaps;                /* number of maps below */
  46.     XStandardColormap *maps;        /* the actual maps */
  47. } StdCmap;
  48.  
  49. #define SIZE_HINDENT 10
  50. #define SIZE_VINDENT 2
  51.  
  52. typedef struct _TitlebarPixmaps {
  53.     Pixmap xlogo;
  54.     Pixmap resize;
  55.     Pixmap question;
  56.     Pixmap menu;
  57.     Pixmap delete;
  58. } TitlebarPixmaps;
  59.  
  60. typedef struct ScreenInfo
  61. {
  62.     int screen;            /* the default screen */
  63.     int d_depth;        /* copy of DefaultDepth(dpy, screen) */
  64.     Visual *d_visual;        /* copy of DefaultVisual(dpy, screen) */
  65.     int Monochrome;        /* is the display monochrome ? */
  66.     int MyDisplayWidth;        /* my copy of DisplayWidth(dpy, screen) */
  67.     int MyDisplayHeight;    /* my copy of DisplayHeight(dpy, screen) */
  68.     int MaxWindowWidth;        /* largest window to allow */
  69.     int MaxWindowHeight;    /* ditto */
  70.  
  71.     TwmWindow TwmRoot;        /* the head of the twm window list */
  72.  
  73.     Window Root;        /* the root window */
  74.     Window SizeWindow;        /* the resize dimensions window */
  75.     Window InfoWindow;        /* the information window */
  76.  
  77.     name_list *Icons;        /* list of icon pixmaps */
  78.     TitlebarPixmaps tbpm;    /* titlebar pixmaps */
  79.     Pixmap UnknownPm;        /* the unknown icon pixmap */
  80.     Pixmap siconifyPm;        /* the icon manager iconify pixmap */
  81.     Pixmap pullPm;        /* pull right menu icon */
  82.     int    pullW, pullH;        /* size of pull right menu icon */
  83.     Pixmap hilitePm;        /* focus highlight window background */
  84.     int hilite_pm_width, hilite_pm_height;  /* cache the size */
  85.  
  86.     MenuRoot *MenuList;        /* head of the menu list */
  87.     MenuRoot *LastMenu;        /* the last menu (mostly unused?) */
  88.     MenuRoot *Windows;        /* the TwmWindows menu */
  89.  
  90.     TwmWindow *Ring;        /* one of the windows in window ring */
  91.     TwmWindow *RingLeader;    /* current winodw in ring */
  92.  
  93.     MouseButton Mouse[MAX_BUTTONS+1][NUM_CONTEXTS][MOD_SIZE];
  94.     MouseButton DefaultFunction;
  95.     MouseButton WindowFunction;
  96.  
  97.     struct {
  98.       Colormaps *cmaps;     /* current list of colormap windows */
  99.       int maxCmaps;        /* maximum number of installed colormaps */
  100.       unsigned long first_req;    /* seq # for first XInstallColormap() req in
  101.                    pass thru loading a colortable list */
  102.       int root_pushes;        /* current push level to install root
  103.                    colormap windows */
  104.       TwmWindow *pushed_window;    /* saved window to install when pushes drops
  105.                    to zero */
  106.     } cmapInfo;
  107.  
  108.     struct {
  109.     StdCmap *head, *tail;        /* list of maps */
  110.     StdCmap *mru;            /* most recently used in list */
  111.     int mruindex;            /* index of mru in entry */
  112.     } StdCmapInfo;
  113.  
  114.     struct {
  115.     int nleft, nright;        /* numbers of buttons in list */
  116.     TitleButton *head;        /* start of list */
  117.     int border;            /* button border */
  118.     int pad;            /* button-padding */
  119.     int width;            /* width of single button & border */
  120.     int leftx;            /* start of left buttons */
  121.     int titlex;            /* start of title string */
  122.     int rightoff;            /* offset back from right edge */
  123.     } TBInfo;
  124.     ColorPair BorderTileC;    /* border tile colors */
  125.     ColorPair TitleC;        /* titlebar colors */
  126.     ColorPair MenuC;        /* menu colors */
  127.     ColorPair MenuTitleC;    /* menu title colors */
  128.     ColorPair IconC;        /* icon colors */
  129.     ColorPair IconManagerC;    /* icon manager colors */
  130.     ColorPair DefaultC;        /* default colors */
  131.     Pixel BorderColor;        /* color of window borders */
  132.     Pixel MenuShadowColor;    /* menu shadow color */
  133.     Pixel IconBorderColor;    /* icon border color */
  134.     Pixel IconManagerHighlight;    /* icon manager highlight */
  135.  
  136.     Cursor TitleCursor;        /* title bar cursor */
  137.     Cursor FrameCursor;        /* frame cursor */
  138.     Cursor IconCursor;        /* icon cursor */
  139.     Cursor IconMgrCursor;    /* icon manager cursor */
  140.     Cursor ButtonCursor;    /* title bar button cursor */
  141.     Cursor MoveCursor;        /* move cursor */
  142.     Cursor ResizeCursor;    /* resize cursor */
  143.     Cursor WaitCursor;        /* wait a while cursor */
  144.     Cursor MenuCursor;        /* menu cursor */
  145.     Cursor SelectCursor;    /* dot cursor for f.move, etc. from menus */
  146.     Cursor DestroyCursor;        /* skull and cross bones, f.destroy */
  147.  
  148.     name_list *BorderColorL;
  149.     name_list *IconBorderColorL;
  150.     name_list *BorderTileForegroundL;
  151.     name_list *BorderTileBackgroundL;
  152.     name_list *TitleForegroundL;
  153.     name_list *TitleBackgroundL;
  154.     name_list *IconForegroundL;
  155.     name_list *IconBackgroundL;
  156.     name_list *IconManagerFL;
  157.     name_list *IconManagerBL;
  158.     name_list *IconMgrs;
  159.     name_list *NoTitle;        /* list of window names with no title bar */
  160.     name_list *MakeTitle;    /* list of window names with title bar */
  161.     name_list *AutoRaise;    /* list of window names to auto-raise */
  162.     name_list *IconNames;    /* list of window names and icon names */
  163.     name_list *NoHighlight;    /* list of windows to not highlight */
  164.     name_list *NoStackModeL;    /* windows to ignore stack mode requests */
  165.     name_list *NoTitleHighlight;/* list of windows to not highlight the TB*/
  166.     name_list *DontIconify;    /* don't iconify by unmapping */
  167.     name_list *IconMgrNoShow;    /* don't show in the icon manager */
  168.     name_list *IconMgrShow;    /* show in the icon manager */
  169.     name_list *IconifyByUn;    /* windows to iconify by unmapping */
  170.     name_list *StartIconified;    /* windows to start iconic */
  171.     name_list *IconManagerHighlightL;    /* icon manager highlight colors */
  172.     name_list *SqueezeTitleL;        /* windows of which to squeeze title */
  173.     name_list *DontSqueezeTitleL;    /* windows of which not to squeeze */
  174.     name_list *WindowRingL;    /* windows in ring */
  175.     name_list *WarpCursorL;    /* windows to warp cursor to on deiconify */
  176.  
  177.     GC NormalGC;        /* normal GC for everything */
  178.     GC MenuGC;            /* gc for menus */
  179.     GC DrawGC;            /* GC to draw lines for move and resize */
  180.  
  181.     unsigned long Black;
  182.     unsigned long White;
  183.     unsigned long XORvalue;    /* number to use when drawing xor'ed */
  184.     MyFont TitleBarFont;    /* title bar font structure */
  185.     MyFont MenuFont;        /* menu font structure */
  186.     MyFont IconFont;        /* icon font structure */
  187.     MyFont SizeFont;        /* resize font structure */
  188.     MyFont IconManagerFont;    /* window list font structure */
  189.     MyFont DefaultFont;
  190.     IconMgr iconmgr;        /* default icon manager */
  191.     struct IconRegion *FirstRegion;    /* pointer to icon regions */
  192.     struct IconRegion *LastRegion;    /* pointer to the last icon region */
  193.     char *IconDirectory;    /* icon directory to search */
  194.     int SizeStringOffset;    /* x offset in size window for drawing */
  195.     int SizeStringWidth;    /* minimum width of size window */
  196.     int BorderWidth;        /* border width of twm windows */
  197.     int IconBorderWidth;    /* border width of icon windows */
  198.     int UnknownWidth;        /* width of the unknown icon */
  199.     int UnknownHeight;        /* height of the unknown icon */
  200.     int TitleHeight;        /* height of the title bar window */
  201.     TwmWindow *Focus;        /* the twm window that has focus */
  202.     int EntryHeight;        /* menu entry height */
  203.     int FramePadding;        /* distance between decorations and border */
  204.     int TitlePadding;        /* distance between items in titlebar */
  205.     int ButtonIndent;        /* amount to shrink buttons on each side */
  206.     int NumAutoRaises;        /* number of autoraise windows on screen */
  207.     short NoDefaults;        /* do not add in default UI stuff */
  208.     short UsePPosition;        /* what do with PPosition, see values below */
  209.     short AutoRelativeResize;    /* start resize relative to position in quad */
  210.     short FocusRoot;        /* is the input focus on the root ? */
  211.     short WarpCursor;        /* warp cursor on de-iconify ? */
  212.     short ForceIcon;        /* force the icon to the user specified */
  213.     short NoGrabServer;        /* don't do server grabs */
  214.     short NoRaiseMove;        /* don't raise window following move */
  215.     short NoRaiseResize;    /* don't raise window following resize */
  216.     short NoRaiseDeicon;    /* don't raise window on deiconify */
  217.     short NoRaiseWarp;        /* don't raise window on warp */
  218.     short DontMoveOff;        /* don't allow windows to be moved off */
  219.     short DoZoom;        /* zoom in and out of icons */
  220.     short TitleFocus;        /* focus on window in title bar ? */
  221.     short NoTitlebar;        /* put title bars on windows */
  222.     short DecorateTransients;    /* put title bars on transients */
  223.     short IconifyByUnmapping;    /* simply unmap windows when iconifying */
  224.     short ShowIconManager;    /* display the window list */
  225.     short IconManagerDontShow;    /* show nothing in the icon manager */
  226.     short BackingStore;        /* use backing store for menus */
  227.     short SaveUnder;        /* use save under's for menus */
  228.     short RandomPlacement;    /* randomly place windows that no give hints */
  229.     short OpaqueMove;        /* move the window rather than outline */
  230.     short Highlight;        /* should we highlight the window borders */
  231.     short StackMode;        /* should we honor stack mode requests */
  232.     short TitleHighlight;    /* should we highlight the titlebar */
  233.     short MoveDelta;        /* number of pixels before f.move starts */
  234.     short ZoomCount;        /* zoom outline count */
  235.     short SortIconMgr;        /* sort entries in the icon manager */
  236.     short Shadow;        /* show the menu shadow */
  237.     short InterpolateMenuColors;/* make pretty menus */
  238.     short NoIconManagers;    /* Don't create any icon managers */
  239.     short ClientBorderWidth;    /* respect client window border width */
  240.     short SqueezeTitle;        /* make title as small as possible */
  241.     short HaveFonts;        /* set if fonts have been loaded */
  242.     short FirstTime;        /* first time we've read .twmrc */
  243.     short CaseSensitive;    /* be case-sensitive when sorting names */
  244.     short WarpUnmapped;        /* allow warping to unmapped windows */
  245.  
  246.     FuncKey FuncKeyRoot;
  247. } ScreenInfo;
  248.  
  249. extern int MultiScreen;
  250. extern int NumScreens;
  251. extern ScreenInfo **ScreenList;
  252. extern ScreenInfo *Scr;
  253. extern int FirstScreen;
  254.  
  255. #define PPOS_OFF 0
  256. #define PPOS_ON 1
  257. #define PPOS_NON_ZERO 2
  258. /* may eventually want an option for having the PPosition be the initial
  259.    location for the drag lines */
  260.  
  261. #endif /* _SCREEN_ */
  262.